class ChromePluginContext {
    constructor(bannerName) {
      this.bannerName = bannerName
    }
    setPlugin(plugin) {
      this.plugin = plugin
    }
    run() {
      printBanner(this.bannerName)
      this.plugin.install()
    }
  }
  

function main() {
    let context = new ChromePluginContext(fuoZuBanner)
    const host = window.location.host
    if (host.indexOf('taobao') !== -1) {
      context.setPlugin(new ChromePluginTaobao())
    } else if (host.indexOf('1688') !== -1) {
      context.setPlugin(new ChromePlugin1688())
    } else if (host.indexOf('yangkeduo') !== -1) {
      context.setPlugin(new ChromePluginPdd())
    }
    context.run()
  };
  
  window.onload = main
  